<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['安装管理[环卫]','图纸方案管理']" icon="fa fa-newspaper-o" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>图纸方案管理</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn" style="width: calc(100% - 220px);">
							    <!--<div class="top_module top_module_box">
                                    <span class="top_module_label module_text">图纸编号</span>
                                    <input type="text" class="module_inp" [(ngModel)]="tableParam.number"/>
                                </div>-->
							    
							    <div class="top_module">
                                    <span class="module_text">零件类型</span>
                                    <select class="module_inp" [(ngModel)]="tableParam.componentType">
                                        <option value="">全部</option>
                                    	<option value="挂齿版">挂齿版</option>
                                    	<option value="竖梁">竖梁</option>
                                    	<option value="挡板安装组件">挡板安装组件</option>
                                    	<option value="通用件">通用件</option>
                                    </select>
                                </div>
                                
                                <!--<div class="top_module top_module_box">
                                    <span class="top_module_label module_text">零件名称</span>
                                    <input type="text" class="module_inp" [(ngModel)]="tableParam.componentName"/>
                                </div>-->
                                <div class="top_module top_module_box">
                                    <span class="top_module_label module_text">启用状态</span>
                                    <select name="" class="module_inp" [(ngModel)]="tableParam.enable">
                                        <option value="">全部</option>
                                        <option value="1">启用</option>
                                        <option value="0">不启用</option>
                                    </select>
                                </div>
								<div class="top_module">
									<span class="module_text">录入人员</span>
									<div class="s_hover_box">
										<select   class="select2"  id="userNameSelect2" style="width: 150px;">
											<option value=''></option>
										</select>
										<div class="s_del_icon" (click)='delUserName()'>x</div>
									</div>
								</div>
                                <div class="selectDate top_module">
                                    <table-select-date [notInit]='true' (outerTime)="getSelectTableTime($event)" ></table-select-date>
                                </div>
								<button class="btn btn-primary" (click)="tableSearch()">查询</button>
								<button class="btn btn-primary" (click)="addDrawingsScheme(drawingsSchemeModal)">添加</button>
							</div>
							<div class="right top-search">
								<input type="text" [(ngModel)]="tableParam.searchKey" (change)="tableSearch()" class="search-input" placeholder="图纸编号、零件名称">
								<span class="top-search-box">
							        <button class="top-search-btn" type="button" (click)="tableSearch()"> <i class="fa fa-search"></i></button>
							    </span>
							</div>
						</div>
						<div class="" style="">
                            <ul class="nav nav-tabs" style="padding-left:12px;background-image: linear-gradient(#F1F5FD, #E9F0FF);padding: 0;">
                                <li class="active s-lis"><a data-toggle="tab" href="#carType0213" (click)="btnClick('0213')">侧挂链条 </a></li>
                                <li class="s-lis"><a data-toggle="tab" href="#carType0214" (click)="btnClick('0214')">侧挂拉杆</a></li>
                                <li class="s-lis"><a data-toggle="tab" href="#carType0211" (click)="btnClick('0211')">后挂双桶</a></li>
                            </ul>
                        </div>
                        
                        <div class="tab-content">
                            <div class="tab-pane active" id="carType0213">
                                <div class="table_scroll">
                                    <table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
                                        <thead>
                                            <tr>
                                                <th>车型</th>
                                                <th>图纸编号</th>
                                                <th>零件类型</th>
                                                <th>零件名称</th>
                                                <th>零件规格</th>
                                                <th>材料规格</th>
                                                <th>方案详情</th>
                                                <th>是否启用</th>
                                                <th>录入人员</th>
                                                <th>录入时间</th>
                                                <th>更新人员</th>
                                                <th>更新时间</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr *ngFor="let row of tableData; let i = index" [attr.data-index]="i">
                                                <td>
                                                    <span *ngIf="row.useTypeL2 == '0211'">后挂双桶</span>
                                                    <span *ngIf="row.useTypeL2 == '0213'">侧挂链条</span>
                                                    <span *ngIf="row.useTypeL2 == '0214'">侧挂拉杆</span>
                                                </td>
                                                <td>{{row.number}}</td>
                                                <td>{{row.componentType}}</td>
                                                <td>{{row.componentName}}</td>
                                                <td>{{row.componentSize}}</td>
                                                <td>{{row.material}}</td>
                                                <td>
                                                    <button type="button" (click)="viewRow(row,drawingsSchemeModal)">查看</button>
                                                </td>
                                                <td>
                                                    <span *ngIf="row.enable == '1'" class="green">启用</span>
                                                    <span *ngIf="row.enable == '0'" class="red">禁用</span>
                                                </td>
                                                <td>{{row.createForUser}}</td>
                                                <td>{{row.createTime}}</td>
                                                <td>{{row.updateForUser}}</td>
                                                <td>{{row.updateTime}}</td>
                                                <td>
                                                    <button type="button" (click)="editRow(row,drawingsSchemeModal)">编辑</button>
                                                    <button type="button" (click)="deleteRow(row)">删除</button>
                                                </td>
                                                
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="table-fix clearfix">
                                    <paginator [totalRecords]="totalCount"
                                           [rows]="pageSize"
                                           [currentPage]="curPage - 1"
                                           (onPageChange)="paginate($event)">
                                    </paginator>
                                    <button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
                                </div>
                                
                            </div>
                            
                            <div class="tab-pane" id="carType0214">
                                <div class="table_scroll">
                                    <table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
                                        <thead>
                                            <tr>
                                                <th>车型</th>
                                                <th>图纸编号</th>
                                                <th>零件类型</th>
                                                <th>零件名称</th>
                                                <th>零件规格</th>
                                                <th>材料规格</th>
                                                <th>方案详情</th>
                                                <th>是否启用</th>
                                                <th>录入人员</th>
                                                <th>录入时间</th>
                                                <th>更新人员</th>
                                                <th>更新时间</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr *ngFor="let row of tableData; let i = index" [attr.data-index]="i">
                                                <td>
                                                    <span *ngIf="row.useTypeL2 == '0211'">后挂双桶</span>
                                                    <span *ngIf="row.useTypeL2 == '0213'">侧挂链条</span>
                                                    <span *ngIf="row.useTypeL2 == '0214'">侧挂拉杆</span>
                                                </td>
                                                <td>{{row.number}}</td>
                                                <td>{{row.componentType}}</td>
                                                <td>{{row.componentName}}</td>
                                                <td>{{row.componentSize}}</td>
                                                <td>{{row.material}}</td>
                                                <td>
                                                    <button type="button" (click)="viewRow(row,drawingsSchemeModal)">查看</button>
                                                </td>
                                                <td>
                                                    <span *ngIf="row.enable == '1'" class="green">启用</span>
                                                    <span *ngIf="row.enable == '0'" class="red">禁用</span>
                                                </td>
                                                <td>{{row.createForUser}}</td>
                                                <td>{{row.createTime}}</td>
                                                <td>{{row.updateForUser}}</td>
                                                <td>{{row.updateTime}}</td>
                                                <td>
                                                    <button type="button" (click)="editRow(row,drawingsSchemeModal)">编辑</button>
                                                    <button type="button" (click)="deleteRow(row)">删除</button>
                                                </td>
                                                
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="table-fix clearfix">
                                    <paginator [totalRecords]="totalCount"
                                           [rows]="pageSize"
                                           [currentPage]="curPage - 1"
                                           (onPageChange)="paginate($event)">
                                    </paginator>
                                    <button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
                                </div>
                                
                            </div>
                            
                            <div class="tab-pane" id="carType0211">
                                <div class="table_scroll">
                                    <table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
                                        <thead>
                                            <tr>
                                                <th>车型</th>
                                                <th>图纸编号</th>
                                                <th>零件类型</th>
                                                <th>零件名称</th>
                                                <th>零件规格</th>
                                                <th>材料规格</th>
                                                <th>方案详情</th>
                                                <th>是否启用</th>
                                                <th>录入人员</th>
                                                <th>录入时间</th>
                                                <th>更新人员</th>
                                                <th>更新时间</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr *ngFor="let row of tableData; let i = index" [attr.data-index]="i">
                                                <td>
                                                    <span *ngIf="row.useTypeL2 == '0211'">后挂双桶</span>
                                                    <span *ngIf="row.useTypeL2 == '0213'">侧挂链条</span>
                                                    <span *ngIf="row.useTypeL2 == '0214'">侧挂拉杆</span>
                                                </td>
                                                <td>{{row.number}}</td>
                                                <td>{{row.componentType}}</td>
                                                <td>{{row.componentName}}</td>
                                                <td>{{row.componentSize}}</td>
                                                <td>{{row.material}}</td>
                                                <td>
                                                    <button type="button" (click)="viewRow(row,drawingsSchemeModal)">查看</button>
                                                </td>
                                                <td>
                                                    <span *ngIf="row.enable == '1'" class="green">启用</span>
                                                    <span *ngIf="row.enable == '0'" class="red">禁用</span>
                                                </td>
                                                <td>{{row.createForUser}}</td>
                                                <td>{{row.createTime}}</td>
                                                <td>{{row.updateForUser}}</td>
                                                <td>{{row.updateTime}}</td>
                                                <td>
                                                    <button type="button" (click)="editRow(row,drawingsSchemeModal)">编辑</button>
                                                    <button type="button" (click)="deleteRow(row)">删除</button>
                                                </td>
                                                
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="table-fix clearfix">
                                    <paginator [totalRecords]="totalCount"
                                           [rows]="pageSize"
                                           [currentPage]="curPage - 1"
                                           (onPageChange)="paginate($event)">
                                    </paginator>
                                    <button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
                                </div>
                            </div>
                        </div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
	<!-- 图片查看   弹窗-->
    <section bsModal #ImgModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" (click)="imgClose(ImgModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>     
                    <h4 class="modal-title">{{activeImg.title}}图片</h4>
                </div>
                <div class="modal-body" style="min-height: 200px;">
                    <div class="row form-horizontal imagesInfo activeImg">
                        <div *ngIf="activeImg.url" style="text-align: center; max-height: 480px;">
                            <img [src]="activeImg.url" [alt]="activeImg.title" style="max-height: 420px;width: auto;height: 100%;" (click)="bigimg('activeImg')"/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- 图片查看 弹窗end-->
    
    <!-- 新增图纸方案   弹窗-->
    <section bsModal #drawingsSchemeModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-lg">
    
    
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" (click)="closeDrawingsSchemeModal(drawingsSchemeModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>     
                    <h4 class="modal-title"><span *ngIf="formType == 'add'">新增</span><span *ngIf="formType == 'update'">编辑</span>图纸方案</h4>
                </div>
                <form id="drawingsSchemeForm"  class="form-horizontal" role="form" novalidate="novalidate" [saBootstrapValidator]="validatorOptions">
                    <div class="modal-body">
                        <div class="row form-horizontal">
    
                           <div class="form-group col-xs-12">
                                <label class="control-label col-xs-3">车型<sup>*</sup></label>
                                <div class="col-xs-9" >
                                    <select class="form-control" name="useTypeL2" [(ngModel)]='drawingsSchemeForm.useTypeL2' (change)="partTypeChange()" [disabled]="formType == 'readonly'">
                                        <option value="">请选择</option>
                                        <option value="0213">侧挂链条</option>
                                        <option value="0214">侧挂拉杆</option>
                                        <option value="0211">后挂双桶</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group col-xs-12">
                                <label class="control-label col-xs-3">零件类型<sup>*</sup></label>
                                <div class="col-xs-9">
                                    <select class="form-control" name="componentType" (click)="clickPartType()" [(ngModel)]='drawingsSchemeForm.componentType' (change)="useTypeL2Change()" [disabled]="formType == 'readonly'">
                                        <option value="">请选择</option>
                                        <option [value]="item.componentType" *ngFor="let item of popPartTypeOption">{{item.componentType}}</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group col-xs-12">
                                <label class="control-label col-xs-3">零件名称<sup>*</sup></label>
                                <div class="col-xs-9" >
                                    <input class="form-control" name="componentName"  [(ngModel)]='drawingsSchemeForm.componentName' placeholder="零件名称" [disabled]="formType == 'readonly'"/>
                                </div>
                            </div>
                            <div class="form-group col-xs-12">
                                <label class="control-label col-xs-3">零件规格[mm]<sup>*</sup></label>
                                <div class="col-xs-9" >
                                    <input class="form-control" name="componentSize"  [(ngModel)]='drawingsSchemeForm.componentSize' placeholder="零件规格" [disabled]="formType == 'readonly'"/>
                                </div>
                            </div>
                            <div class="form-group col-xs-12">
                                <label class="control-label col-xs-3">材料规格<sup>*</sup></label>
                                <div class="col-xs-9" >
                                    <input class="form-control" name="material"  [(ngModel)]='drawingsSchemeForm.material' placeholder="材料规格" [disabled]="formType == 'readonly'"/>
                                </div>
                            </div>
                            <div class="form-group col-xs-12">
                                <label class="control-label col-xs-3">对应数量<sup>*</sup></label>
                                <div class="col-xs-9" >
                                    <input class="form-control" name="count"  [(ngModel)]='drawingsSchemeForm.count' placeholder="对应数量"  onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"  [disabled]="formType == 'readonly'"/>
                                </div>
                            </div>
                            <div class="form-group col-xs-12">
                            <label class="control-label col-xs-3">启用状态</label>
                                <div class="col-xs-9" >
                                    <td class="smart-form" style="padding: 7px 10px;text-align: center;" *ngIf="formType != 'readonly'">
                                        <input  style="margin-right: 5px;display: none;" name="enable" class="isStatus" type="checkbox" [checked]="drawingsSchemeForm.enable"/>
                                    </td>
                                    <td class="smart-form" style="height:28px;line-height:28px;text-align: center;" *ngIf="formType == 'readonly'">
                                        <div class="mySwitch" *ngIf="drawingsSchemeForm.enable == '0'"><span class="white"></span><span class="closeText">关闭</span></div>
                                        <div class="mySwitch" *ngIf="drawingsSchemeForm.enable == '1'"><span  class="openText">开启</span><span class="white"></span></div>
                                    </td>
                                </div>
                            </div>
                            <div style="border-top: 1px solid #ccc;margin-bottom: 16px;clear: both;padding-top: 12px;font-weight: bold;font-size: 14px;">匹配条件<sup>*</sup></div>
                            <div *ngIf="drawingsSchemeForm.drawManageDetailEntities && drawingsSchemeForm.drawManageDetailEntities.length">
                                <div class="form-group col-xs-12" *ngFor="let item of drawingsSchemeForm.drawManageDetailEntities">
                                    <label class="control-label col-xs-4">{{item.index}}、{{item.name}}</label>
                                    <div class="col-xs-8" >
                                        <input class="form-control inline_block" style="width: 80px;" [name]="'min'+item.index" [(ngModel)]='item.min' placeholder="数值" [disabled]="formType == 'readonly'"/>
                                        <div class="inline_block">~</div>
                                        <input class="form-control inline_block" style="width: 80px;" [name]="'max'+item.index"  [(ngModel)]='item.max' placeholder="数值" [disabled]="formType == 'readonly'"/>
                                        <span>mm</span>
                                    </div>
                                </div>
                            </div>
                            <div style="border-top: 1px solid #ccc;margin-bottom: 16px;clear: both;padding-top: 12px;font-weight: bold;font-size: 14px;">零件图纸<sup>*</sup></div>
                            <div class="form-group col-xs-12">
                                <label class="control-label col-xs-3 no-padding-right"></label>
                                <div class="col-xs-9">
                                    <div class="imgFileList">
                                        <div class="imgFileList-other">
                                            <div class="imgFileList-multifile">
                                                <div class="uploadlocation uploadlocation1"> 
                                                    <div class="content-list viewer1">
                                                        <div class="headImg" *ngFor="let item of imageInfo.imageList; let i = index">
                                                            <div class="contentImg"><img class="img" alt="零件图纸"  [src]="item" (click)="bigimg('viewer1')"></div>
                                                                <i class="deleteImg" (click)="deleteImg('1',i)" *ngIf="formType != 'readonly'"></i>
                                                        </div>
                                                        <button type="button"  class="btn div_imgall" *ngIf="formType != 'readonly'">
                                                            <div class="div_shuline"></div>
                                                            <div class="div_hengline"></div>
                                                            <input type="file" class="up" title=" " placeholder=" "  (change)="multifileChange($event.target.files)"/>
                                                        </button>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
    
                        </div>
                    </div>
                    <div class="modal-footer" *ngIf="formType != 'readonly'">
                        <button type="button" class="btn btn-default" (click)="closeDrawingsSchemeModal(drawingsSchemeModal)">取消</button>
                        <button type="button" class="btn btn-primary" (click)="drawingsSchemeSubmit(drawingsSchemeModal)">确认</button>
                    </div>
                </form>
            </div>
    
    
        </div>
    </section>
    <!-- 新增图纸方案 弹窗end-->
    
    
    
</div>